﻿using System.Configuration;

namespace Kaiser.Configuration
{
    public class ModuleConfigurationElement : ConfigurationElement
    {
        public ModuleConfigurationElement() { }

        public ModuleConfigurationElement(string elementName)
        {
            Name = elementName;
        }

        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string Name
        {
            get
            {
                return (string)this["name"];
            }
            set
            {
                this["name"] = value;
            }
        }

        [ConfigurationProperty("type", IsRequired = true)]
        public string Type
        {
            get
            {
                return (string)this["type"];
            }
            set
            {
                this["type"] = value;
            }
        }
        [ConfigurationProperty("skin")]
        public string Skin
        {
            get
            {
                return (string)this["skin"];
            }
            set
            {
                this["skin"] = value;
            }
        }
        [ConfigurationProperty("dataProvider"/*, IsRequired = true*/)]
        public string DataProvider
        {
            get
            {
                return (string)this["dataProvider"];
            }
            set
            {
                this["dataProvider"] = value;
            }
        }

        [ConfigurationProperty("enabled", IsRequired = false, DefaultValue = true)]
        public bool Enabled
        {
            get
            {
                return (bool)this["enabled"];
            }
            set
            {
                this["enabled"] = value;
            }
        }

        [ConfigurationProperty("settings")]
        public SettingConfigurationElementCollection Settings
        {
            get
            {
                return (SettingConfigurationElementCollection)this["settings"];
            }
            set
            {
                this["settings"] = value;
            }
        }
        /*
        [ConfigurationProperty("settings")]
        public KeyValueConfigurationCollection Settings
        {
            get
            {
                return (KeyValueConfigurationCollection)this["settings"];
            }
            set
            {
                this["settings"] = value;
            }
        }
        */
    }
}
